///\file light.cpp
///\brief contient les spécialisations des templates de Light
///\author Allan BLANCHARD
#include "light.hh"

template<>
void Light<0>::activate(){
  glLightfv(GL_LIGHT0, GL_AMBIENT, amb);
  glLightfv(GL_LIGHT0, GL_DIFFUSE, dif);
  glLightfv(GL_LIGHT0, GL_SPECULAR, spe);
  glLightfv(GL_LIGHT0, GL_POSITION, static_cast<float*>(pos));
  glEnable(GL_LIGHT0);
}

template<>
void Light<0>::deactivate(){
  glDisable(GL_LIGHT0);
}

template<>
void Light<1>::activate(){
  glLightfv(GL_LIGHT1, GL_AMBIENT, amb);
  glLightfv(GL_LIGHT1, GL_DIFFUSE, dif);
  glLightfv(GL_LIGHT1, GL_SPECULAR, spe);
  glLightfv(GL_LIGHT1, GL_POSITION, static_cast<float*>(pos));
  glEnable(GL_LIGHT1);
}

template<>
void Light<1>::deactivate(){
  glDisable(GL_LIGHT1);
}

template<>
void Light<2>::activate(){
  glLightfv(GL_LIGHT2, GL_AMBIENT, amb);
  glLightfv(GL_LIGHT2, GL_DIFFUSE, dif);
  glLightfv(GL_LIGHT2, GL_SPECULAR, spe);
  glLightfv(GL_LIGHT2, GL_POSITION, static_cast<float*>(pos));
  glEnable(GL_LIGHT2);
}

template<>
void Light<2>::deactivate(){
  glDisable(GL_LIGHT2);
}
